package net.csdn.business.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName NameSpaceTypeEnum
 * @Description TODO
 * @Author liuzhisheng
 * @Date 2023/11/28
 **/

@AllArgsConstructor
@Getter
public enum  NameSpaceTypeEnum {
    INDIVIDUAL(1, "personal"),
    ORGANIZATION(2, "group");

    private final Integer code;
    private final String description;

    public static NameSpaceTypeEnum fromCode(Integer code) {
        for (NameSpaceTypeEnum type : NameSpaceTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid TargetType code: " + code);
    }
}
